/**
 * 用户路由模块
 */
const express = require('express');
const router = express.Router();

const {
  getAllUsers,
  getUserById,
  createUser,
  updateUser,
  deleteUser
} = require('./users.controller');

// 获取所有用户 & 创建用户
router.route('/')
  .get(getAllUsers)
  .post(createUser);

// 获取、更新和删除单个用户
router.route('/:id')
  .get(getUserById)
  .put(updateUser)
  .delete(deleteUser);

module.exports = router; 